<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title th:text="${session.title}">123</title>
    <link th:replace="common/header"/>
    <link rel="stylesheet" th:href="@{/css/ace-skins.min.css}"/>
</head>
<body class="navbar-fixed">
<div th:replace="common/top"></div>
<div class="container-fluid main_bg" id="main-container">
    <a id="menu-toggler" href="#"><span></span></a>
    <div th:replace="common/menu"></div>
    <div id="main-content" class="clearfix">
        <div id="page-content" class="clearfix">
            <div th:replace="common/title"></div>
            <h3 class="header smaller lighter blue"
                th:utext="'<em class=icon-eye-open></em>' + ${session.footUser.nike} + '的任务'">123</h3>
            <div th:if="${session.footUser.qx.text == '会员' || session.footUser.qx.text == 'VIP1' || session.footUser.qx.text == 'VIP2' || session.footUser.qx.text == 'VIP3'}">
                <div class="row-fluid" th:if="${null == list[0] || null == list[1]}">
                    <!--PAGE CONTENT BEGINS HERE-->
                    <div class="span12">
                        <span th:text="'没有找到' + ${session.footUser.nike} + '的任务信息'">123</span>
                    </div>
                </div>
                <div class="row-fluid" th:if="${null != list[0] && null != list[1]}">
                    <!--PAGE CONTENT BEGINS HERE-->
                    <div class="span12">
                        <div class="row-fluid">
                            <!--PAGE CONTENT BEGINS HERE-->
                            <div class="span6" th:each="t, index:${list}">
                                <div class="control-group">
                                    <div class="controls">
                                        <img th:src="@{'/images/mission/mission' + ${index.count} + '.png'}" alt=""
                                             src=""/>
                                    </div>
                                    <div class="controls">
                                        <div class="row-fluid">
                                            <div class="span6">
                                                <p th:text="'任务名称:' + ${t.missionName}">123</p>
                                                <p th:text="'任务目前达成数 :' + ${num[index.index] + '/' + t.missionNum}">
                                                    123</p>
                                                <p th:text="'任务描述:' + ${t.missionDetail}">123</p>
                                                <p th:text="'是否领取当前任务 :' + ${t.complete == true ? '是' : '否'}">123</p>
                                                <p th:text="'任务创建时间:' + ${#dates.format(t.createTime,'yyyy-MM-dd')}">
                                                    123</p>
                                            </div>
                                            <div class="span6"
                                                 th:if="${num[index.index] >= t.missionNum && !t.complete}">
                                                <button class="btn-mini" type="button"
                                                        th:onclick="'javascript:getMissionMoney(' + ${index.count} + ',' + ${t.id} + ');'">
                                                    <em class="icon-arrow-left"></em>完成任务
                                                </button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="row-fluid">
                    <div class="text-center span12">
                        <a class="btn" type="button" th:href="@{/index}"><em class="icon-arrow-left"></em>返回首页</a>
                    </div>
                </div>
            </div>
            <!--/#page-content-->
        </div>
        <div th:replace="common/skin :: skin"></div>
    </div><!--/#main-content-->
</div><!--/.fluid-container#main-container-->
<div th:replace="common/js"></div>
<script type="text/javascript">
    function getMissionMoney(type, id) {
        $.ajax({
            type: "POST",
            dataType: "json",
            url: "/hy/footMission/getMissionMoney",
            data: "id=" + id + "&num=" + type,
            success: function (data) {
                if (data.msg === 'ok') {
                    showTip('tip', '已经领取奖励5PB成功', 4000);
                    window.location.reload();
                }
            }
        });
    }
</script>
</body>
</html>
